<#import "../../pageTemplate.ftl" as pager>
<div class="panel-body">
    <div class="pad-btm form-inline">
        <div class="row">
            <div class="col-sm-6 table-toolbar-left"></div>
            <div class="col-sm-6 table-toolbar-right">
                <div class="form-group">
                    <input id="input-search2" value="${searchText!}" type="text" placeholder="输入公司名称" class="form-control" autocomplete="off">
                </div>
                <div class="btn-group">
                    <button class="btn btn-default" onclick="search()">搜索</button>
                </div>
                <div class="btn-group">
                    <button class="btn btn-default" onclick="window.location.reload()">重置</button>
                </div>
            </div>
        </div>
    </div>
    <div class="table-responsive">
        <table class="table table-striped table-bordered" id="dt-basic">
            <thead>
            <tr>
                <th>序号</th>
                <th>公司名称</th>
                <th class="sorting" id="bangStatus" onclick="shortColumn('bangStatus', this)">绑定状态</th>
                <th class="sorting" id="voltageStep" onclick="shortColumn('voltageStep', this)">电压等级（kV）</th>
                <th class="sorting" id="elecConsumption" onclick="shortColumn('elecConsumption', this)">预估年电量（万kWh）</th>
                <th>户号个数</th>
                <th class="sorting" id="types" onclick="shortColumn('types', this)">用户类型</th>
                <th>客户地区</th>
                <th class="sorting" id="saleName" onclick="shortColumn('saleName', this)">销售</th>
                <th class="sorting" id="relatedAt" onclick="shortColumn('relatedAt', this)">关联日期</th>
            </tr>
            </thead>
            <tbody>
            <#if pageData.content?? && (pageData.content?size>0)>
                <#list pageData.content as data>
                <tr>
                    <td>${data_index+1}</td>
                    <td>${data.companyName!}</td>
                    <td><#if data.bangStatus??><#if data.bangStatus ==1>未绑定<#elseif data.bangStatus==2>已绑定<#else>绑定有争议</#if></#if></td>
                    <td>${data.voltageStep!}</td>
                    <td><#if data.elecConsumption??>${(data.elecConsumption?number)/10000}</#if></td>
                    <td>${data.elecAccountNum!}</td>
                    <td><#if data.types??><#if data.types==1>零售用户<#else>电力用户</#if></#if></td>
                    <td>${(data.cityParent.name)!}${(data.currentCity.name)!}</td>
                    <td>${(data.user.name)!}</td>
                    <td><#if data.relatedAt??>${data.relatedAt?string("yyyy-MM-dd")}</#if></td>
                </tr>
                </#list>
            </#if>
            </tbody>
        </table>
    </div>
    <#if pageData.content?? && (pageData.content?size>0)>
        <@pager.p page=pageData.currentPage totalPages=pageData.totalPage functionName="pageChange"/>
    </#if>
</div>
<script src="<@spring.url "/resources/plugins/datatables/jquery.dataTables.js"/>"></script>
<script src="<@spring.url "/resources/plugins/datatables/dataTables.bootstrap.js"/>"></script>
<script src="<@spring.url "/resources/plugins/datatables/dataTables.responsive.min.js"/>"></script>
<script src="<@spring.url "/resources/js/tables-datatables.js"/>"></script>
<script type="text/javascript">
    $('#dt-basic').dataTable( {
        "paging": false,
        "searching" : false,
        "ordering":false,
        "fnDrawCallback":function (settings) {
        }
    });


</script>
